qseed <- function(jobNum=1, jobTot=1, parSeed=rep(1124, 6)){
  # -----------------------------------------------------------------------------
  # Purpose: Initialize a parallel pseudo-RNG stream in R
  # Arguments: jobNum = current job number
  #            jobTot = total number of jobs
  # -----------------------------------------------------------------------------
  require(rlecuyer)
  .lec.SetPackageSeed(parSeed)
  jobNames <- paste("jobNum", 1:jobTot, sep = "")
  .lec.CreateStream(jobNames)   # This sets the seed tables for jobNum jobs
  # This sets the current RNG stream
  .lec.CurrentStream(paste("jobNum", jobNum, sep=""))
}
  
  